package shooting.ui.missilepattern.string
{
	public class StrPattern implements IStrPattern
	{
		private var strArr:Array;
		private var myLength:int = -1;
		
		public function StrPattern()
		{
		}

		public function get length():uint
		{
			return myLength;
		}
		
		public function get data():Array
		{
			return strArr;
		}
		
		public function setData(arr:Array):void
		{
			strArr = arr;
			if(!checkLength())
			{
				myLength = 22;
				strArr = StrPatternSet0.HELLO;
			}
		}
		
		private function checkLength():Boolean
		{
			myLength = -1;
			var i:uint;
			var leng:uint = strArr.length;
			for(i = 0; i< leng; i ++)
			{
				if(myLength == -1)
				{
					myLength = strArr[i].length;
				}
				else
				{
					if(myLength != strArr[i].length)
					{
						return false;
					}
				}
				
			}
			return true;
		}
		
	}
}